<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>Document</title>
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="/css/bootstrap.css" />
    <script src="/js/vue.global.js"></script>
    <script src="/js/axios.min.js"></script>
</head>
<body>
    HOME
    <div id="app">
        <div class="card" style="width: 100%;">
            <div class="card-header">
              Featured
            </div>
            <table class="table table-striped">
                <tr>
                    <table class="table table-striped">
                        <tr>
                            <th> 编号 </th>
                            <th> 姓名 </th>
                            <th> 性别 </th>
                            <th> 电话 </th>
                        </tr>
                        <tr v-for="stu in studentData" :key="stu.stuid">
                            <td> {{stu.stu_no}} </td>
                            <td> {{stu.stu_name}} </td>
                            <td> {{stu.stu_sex?"男": "女"}} </td>
                            <td> {{stu.stu_phone}} </td>
                        </tr>
                    </table>
                </tr>
              </table>
          </div>
    </div>
</body>
</html>
<script>
    const mydata={
        data(){
            return{
                title:"JS方式使用Vue3技术！",
                studentData:[]
            }
        },
        mounted() {
            axios.get("http://localhost:8080/stu/list?clsid=0&stu_name=").then((res)=>{
                this.studentData = res.data
                console.log(this.studentData);
            }).catch((err)=>{})
        },
        methods: {
            btnTest(){
                this.title = "开学了，要上课了！"
                location.href='index.html'
            }

            },
        }

        Vue.createApp(mydata).mount("#app")   
</script>
